package pl.edu.agh.gronoMining.frequentSubgraphFinder.strategy;

import java.util.HashMap;
import java.util.Map;

//import org.apache.log4j.Logger;

/**
 * Simple implementation of Strategy. Uses HashMap with pair <RulePair, Integer>
 */
public class SimpleStrategyImpl implements Strategy {

	//private static final Logger logger = Logger.getLogger(SimpleStrategyImpl.class);
	
	private int startType;
	
	private Map<RulePair, Integer> strategyRulesMap = new HashMap<RulePair, Integer>();
	
	public int getStartType() {
		return startType;
	}
	
	public void setStartType(int type) {
		startType = type;
	}
	
	public Integer getStrategyFor(int firstNodeType, int nextNodeType) {		
		return strategyRulesMap.get(new RulePair(firstNodeType, nextNodeType));
	}
	
	public void addStrategyRule(int firstNodeType, int nextNodeType, int rule) {
		strategyRulesMap.put(new RulePair(firstNodeType, nextNodeType), rule);
	}
	
}

